/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.sabatec.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Daniel.Morais
 */
@Entity
@Table(name = "obraexecsabatec")
@NamedQueries({
    @NamedQuery(name = "ObraExecSabatec.findAll", query = "SELECT o FROM ObraExecSabatec o"),
    @NamedQuery(name = "ObraExecSabatec.findIDService", query = "SELECT o FROM ObraExecSabatec o WHERE o.idservice= :idServiceObra")

})
public class ObraExecSabatec implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "nome")
    private String nome;
	@Basic(optional = false)
    @Column(name = "funcao")
    private String funcao;
    @Basic(optional = false)
    @Column(name = "horat")
    private double horat;
    @Basic(optional = false)
    @Column(name = "data")
    @Temporal(TemporalType.DATE)
    private Date data;
    @JoinColumn(name = "idservice", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private RequestServiceSabatec idservice;

    public ObraExecSabatec() {
    }

    public ObraExecSabatec(Integer id) {
        this.id = id;
    }

    public ObraExecSabatec(Integer id, String nome, String funcao, double horat, Date data) {
        this.id = id;
        this.nome = nome;
        this.funcao = funcao;
        this.horat = horat;
        this.data = data;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}
	
    public String getFuncao() {
        return funcao;
    }

    public void setFuncao(String funcao) {
        this.funcao = funcao;
    }

    public double getHorat() {
        return horat;
    }

    public void setHorat(double horat) {
        this.horat = horat;
    }

    public Date getData() {
        return data;
    }

    public void setData(Date data) {
        this.data = data;
    }

    public RequestServiceSabatec getIdservice() {
        return idservice;
    }

    public void setIdservice(RequestServiceSabatec idservice) {
        this.idservice = idservice;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ObraExecSabatec)) {
            return false;
        }
        ObraExecSabatec other = (ObraExecSabatec) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.sabatec.ObraExecSabatec[ id=" + id + " ]";
    }
    
}
